<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="css/app.css" />
		<link href="css/mui.picker.css" rel="stylesheet" />
		<link href="css/mui.poppicker.css" rel="stylesheet" />
		<!--<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />-->
		<style>
			.mui-btn {
				font-size: 16px;
				padding: 8px;
				margin: 3px;
			}
			
			h5.mui-content-padded {
				margin-left: 3px;
				margin-top: 20px !important;
			}
			
			h5.mui-content-padded:first-child {
				margin-top: 12px !important;
			}
			
			.ui-alert {
				text-align: center;
				padding: 20px 10px;
				font-size: 16px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">阅读密码</h1>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded" align="center">
				原密码<input type="text" name="readpassword" id="readpassword" value="" /> 新密码
				<input type="text" name="readpassword1" id="readpassword1" value="" /> 请再输入新密码
				<input type="text" name="readpassword2" id="readpassword2" value="" />
				<input type="button" name="bcread" id="bcreadpassword" value="保存" />
			</div>
		</div>
		<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
		<script src="js/mui.min.js"></script>
		<!--<script src="../js/mui.picker.min.js"></script>-->
		<script src="js/mui.picker.js"></script>
		<script src="js/mui.poppicker.js"></script>
		<script src="js/city.data-3.js" type="text/javascript" charset="utf-8"></script>
		<script>
			var userid;

			/*var data = JSON.parse(Base64.decode(GetRequest().data));*/
			/*var id = data.id; //传过来的数据*/

			(function($, doc) {
				$.init();

				mui.init({
					//返回父页面刷新
					beforeback: function() {　　　　
						var list = plus.webview.currentWebview().opener();　　　　
						//refresh是父页面自定义事件
						mui.fire(list, 'refresh');
						//返回true,继续页面关闭逻辑
						return true;
					}
				});

				window.onload = function() { //可省略
					//从服务器获取数据
					//业务数据获取完毕，并已插入当前页面DOM；
					//注意：若为ajax请求，则需将如下代码放在处理完ajax响应数据之后；
					mui.plusReady(function() {
						var self = plus.webview.currentWebview();
						var id = self.ids;
						//关闭等待框 
						plus.nativeUI.closeWaiting();
						//显示当前页面
						mui.currentWebview.show();
						alert(id);

						document.getElementById("bcreadpassword").addEventListener("click", function() {
							console.log("进来了");
							mui.ajax('http://338de254.cpolar.io/note-user/user/updateReadPwd', {
								data: {
									token: id,
									id:id,
									passwordxx: document.getElementById('readpassword').value,
									password1: document.getElementById('readpassword1').value,
									password2: document.getElementById('readpassword2').value
								},
								dataType: 'json', //服务器返回json格式数据
								crossDomain: true,
								type: 'post', //HTTP请求类型
								success: function(data) {
									
								},
								error: function(xhr, type, errorThrown) {
									//异常处理；
									console.log(errorThrown);
								}
							});
						});

					});

				};

			})(mui, document);
		</script>
	</body>

</html>